<admintpl file="header"/>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
  <ul class="nav nav-tabs">
     <li class="active"><a href="{:U('Vouchers/index')}">代金卷列表</a></li>
     <li><a href="{:U('Vouchers/add')}">添加代金卷</a></li>
  </ul>
  		<form class="well form-search" method="post" action="{:U('Vouchers/index')}" name="formadd">
			<div class="search_type cc mb10">
				<div class="mb10">
						发布时间：
						<input type="text" name="start_time" value="{$formpost.start_time}" class="J_date" style="width: 80px;">~
						<input type="text" name="end_time" value="{$formpost.end_time}" class="J_date" style="width: 80px;"> &nbsp; &nbsp;
						<input type="submit" class="btn btn-primary" name="search" value="搜索" />
						<if condition="$num neq 0">
							共有 {$num} 条相关记录
						</if>
					</span>
				</div>
			</div>
		</form>
  <form class="form-horizontal J_ajaxForm" method="post">
    <div class="table_list">
      <div class="p10"><div class="pages"> {$Page} </div>
      </div>
      <table width="100%" class="table table-hover">
        <thead>
          <tr>
            <th width="40">ID</th>
            <th>代金卷名称</th>
            <th>代金卷描述</th>
            <th width="50">金额</th>
            <th width="80">特定商品ID</th>
            <th width="60">可用倍数</th>
            <th width="50">有效期</th>
            <th>ID：用户昵称</th>
            <th width="120">发布时间</th>
            <th width="180">管理操作</th>
          </tr>
        </thead>
        <foreach name="lists" item="vo">
        	<tr>
				<td>{$vo.id}</td>
				<td>{$vo.itemDesc}</td>
				<td>
	        	<foreach name="property" item="prope">
	        		<if condition="$prope['itemID'] eq $vo['id']">
	        			{$prope.extraDesc}
	        		</if>
	        	</foreach>
				</td>
				<td>
	        	<foreach name="property" item="prope">
	        		<if condition="$prope['itemID'] eq $vo['id']">
	        			{$prope.itemColor|number_format=2}￥
	        		</if>
	        	</foreach>
				</td>
				<td>
	        	<foreach name="property" item="prope">
	        		<if condition="$prope['itemID'] eq $vo['id']">
	        			{$prope.originalHeld}
	        		</if>
	        	</foreach>
				</td>
				<td>
	        	<foreach name="property" item="prope">
	        		<if condition="$prope['itemID'] eq $vo['id']">
	        			{$prope.extraClass}
	        		</if>
	        	</foreach>
				</td>
				<td>
	        	<foreach name="property" item="prope">
	        		<if condition="$prope['itemID'] eq $vo['id']">
	        			{$prope.itemSize}天
	        		</if>
	        	</foreach>
				</td>
				<td>
        		<foreach name="users" item="user">
						<if condition="$user['id'] eq $vo['userid'] || $user['userid'] eq $vo['userid']">
						{$user.userid}：
						<if condition="$user['user_nicename'] neq ''">
		        			{$user.user_nicename}
		        		<else />
		        			{$user.user_login}
		        </if>
	        	</if>
                </foreach>
                </td>
				<td>{$vo.created}</td>
				<td>
						<a href="{:U('Vouchers/grant',array('id'=>$vo['id']))}">发放代金卷</a>|
						<a href="{:U('Vouchers/edit',array('id'=>$vo['id']))}">修改</a> | 
					<if condition="$roleid eq 1">
						<a class="J_ajax_del" href="{:U('Vouchers/delete',array('id'=>$vo['id']))}">删除</a> | 
        			</if>
					<if condition="$vo['status'] eq 0">
						<a href="{:U('Vouchers/up',array('id'=>$vo['id']))}" class="J_ajax_dialog_btn" data-msg="您确定要启用此优惠卷吗？"style="color: #FF0000;"><b>未启用</b></a>
					<else />
						<a href="{:U('Vouchers/down',array('id'=>$vo['id']))}" class="J_ajax_dialog_btn" data-msg="您确定要停用此优惠卷吗？">已启用 </a>
					</if>
				</td>
			</tr>
        </foreach>
        <thead>
          <tr>
            <th width="40">ID</th>
            <th>代金卷名称</th>
            <th>代金卷描述</th>
            <th width="50">金额</th>
            <th width="80">特定商品ID</th>
            <th width="60">可用倍数</th>
            <th width="50">有效期</th>
            <th>ID：用户昵称</th>
            <th width="120">发布时间</th>
            <th width="180">管理操作</th>
          </tr>
        </thead>
      </table>
      <div class="p10"><div class="pages"> {$Page} </div>
      </div>
    </div>
  </form>

</div>
<script type="text/javascript" src="__ROOT__/statics/js/common.js"></script>
<script type="text/javascript" src="__ROOT__/statics/js/content_addtop.js"></script>
</body>
</html>